<?php
/**
 * Created by PhpStorm.
 * User: win7
 * Date: 2018/5/21
 * Time: 16:20
 */

namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;

use App\Models\Currency;
use App\Models\Property;
use App\Models\User;
use App\Models\Message;
use App\Models\Send;
use App\Library\Orders;
use DB;
class ZrcController extends Controller
{
    public function zrc1(){
        $model = new Orders\Orders();
        $a = $model->property_verif(31,222);
        dump($a);die;
    }

    public function zrc()
    {
        $num = '2.000';
        $currency = Currency::where('name_en','OBA')->first();
        if ($currency->out_value > (float)$num)
            return respF(1039);
        dump( (float)$currency->out_value);
        dump((float)$num);
        die;
        $p = Property::where('uid',12)->first();
        $p->increment('total', 33);

        $a = $p->in('total', 33);
        dump($a);die;
        //写入消息
        $msgArr = [
            'msg_id' => 14,
            'uid' => 21,
            'message' => ['asdaf','kl;dksa;dsa',998],
            'push_message' => ['asdf'],
        ];
        $a = (new Message())->syspublishsmsAll($msgArr);
        dump($a);die;

        dump(data());
        $a = preg_match('/^(13[0-9]|177|199|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/',17700000000);
        dump($a);die;
        $msg_model = new Message();
        $msg = [
            "msg_id" => 7,
            "uid" => 21,
            "message" => [
                "2018-06-04 15:33:24",
                "OBA",
                "1.00000000",
                "10.00000000",
                0.3,
                "10.00000000",
            ],
            "push_message" => [
                "OBA",
            ],
            "title" => [
                0 => "OBA"
            ],
            "arr"=> [
                'number' => 5,
            ]
        ];
        $b = $msg_model->syspublishsmsAll($msg);
        dump($b);



        $ip=getenv ("REMOTE_ADDR");
        dump($ip);die;
        $a = '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊';
        $b = strlen($a);
        dump($b);

        if(strlen($a)>90)
            dump($b);
//        dump($a);dump($b);
        die;
    }



    public function zrc2(){
        $model = new Send();
        $title = '左';
        $msg= '这是一条测试消息 请忽略';
        $a = $model->sends($title,$msg,2);
        dump($a);

    }
}